# -*- coding: utf-8 -*-
from django.db import models

class User(models.Model):
    username = models.CharField(max_length=50,unique=True)
    password = models.CharField(max_length=50)
    is_active = models.PositiveSmallIntegerField(choices=((0, u'未审核'),(1, u'审核通过'),(2, u'审核未通过'),))
    is_update = models.PositiveSmallIntegerField(default=0,choices=((0, u'未有更新'),(1, u'有更新'),))
    extra = models.TextField(blank=True,null=True,default='')
    email = models.EmailField(unique=True)
    phone = models.CharField(max_length=20,null=True)
    usertype = models.PositiveSmallIntegerField(default=0,choices=((0, u'普通成员'),(1, u'管理员')))
    createTime = models.DateTimeField(auto_now=False, auto_now_add=True);
    updateTime = models.DateTimeField(auto_now=True);
    keystone_user_id = models.CharField(max_length=50,null=True)
    
    def __unicode__(self):
        return self.username
